﻿using Microsoft.AspNetCore.Mvc;
using MyDapperApi.Services;
using MyDapperApi.Services.Mbti;
using QYWXUpdate.DataModel;
using System.Threading.Tasks;

namespace MyDapperApi.Controllers;

[ApiController]
[Route("api/[controller]")]
public class MbtiController : ControllerBase
{
    private readonly IMbtiService _mbtiService;

    public MbtiController(IMbtiService mbtiService)
    {
        _mbtiService = mbtiService;
    }
    
    /// <summary>
    /// 保存Mbti测试结果
    /// </summary>
    /// <param name="request"></param>
    /// <returns></returns>
    [HttpPost("SaveMbtiResult")]
    public async Task<IActionResult> SaveMbtiResult(SaveMbtiRequest request)
    {
        var res = await _mbtiService.SaveMbtiResult(request);
        return Ok(res);
    }
}